<?php
namespace AES;

class SignatureClass
{
    public static function getSignature($params, $secret)
    {
        $str = '';
        ksort($params);
        foreach ($params as $k => $v) {
            $str .= "$k=$v&";
        }
        $str .= $secret;
        
        return md5($str);
     }
     
     
     public static function getStr($params)
    {
        $str = '';
        ksort($params);
        foreach ($params as $k => $v) {
            $str .= "$k=$v&";
        }
        $str = rtrim($str,'&');
        return $str;
     }
}